package com.yb.guigu.pick.auth.controller;


import com.yb.guigu.pick.core.bean.GuiguResult;
import com.yb.guigu.pick.auth.service.ISysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 姚兵
 * @since 2023-05-30
 */
@RestController
@RequestMapping("/sys-menu")
public class SysMenuController {

    @Autowired
    ISysMenuService sysMenuService;

    @GetMapping("{userId}")
    public GuiguResult getUserMenu(@PathVariable Long userId) throws InterruptedException {
        return sysMenuService.getUserMenu(userId);
    }

    @GetMapping("/all")
    public GuiguResult getAllMenus() throws InterruptedException {
        return sysMenuService.menuAll();
    }
}
